package com.plian.system.wrapper.pf;

import com.plian.system.dto.pf.ChildGrantSalaryDTO;
import com.plian.system.entity.pf.ChildGrantSalary;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.pf.ChildGrantSalaryVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * @description:
 * @author: gangan
 * @create: 2020-04-23 14:14
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface ChildGrantSalaryWrapper extends BaseWrapper<ChildGrantSalary, ChildGrantSalaryDTO, ChildGrantSalaryVO> {

    /**
     * Entity转VO
     *
     * @param entity /
     * @return /
     */
    @Override
    @Mappings(value = {
            @Mapping(source = "childCompanyId", target = "childCompanyName", qualifiedByName = ORG_ID_TO_NAME),
            @Mapping(source = "childCountCategoryId", target = "childCountCategoryName", qualifiedByName = DICT_CODE_TO_NAME)
    })
    ChildGrantSalaryVO entityToVO(ChildGrantSalary entity);
}
